package com.edu.jvm.unit01.heap;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.TimeUnit;

/**
 * 查看GC详情
 * 测试MinorGC、MajorGC、FullGC
 * @author five-five
 * @date 2021/9/14
 */
public class GCTest {
    public static void main(String[] args) {
        int i = 1;
        try {
            List<String> stringList = new ArrayList<>();
            String a = UUID.randomUUID().toString();
            while (true) {
                stringList.add(a);
                a += a;
                //每次循环让它睡一秒
                TimeUnit.SECONDS.sleep(1);
                i++;
            }
        } catch (Exception e) {
            System.out.println(i);
            e.printStackTrace();
        }
    }
}
